import { ElMessageBox } from "element-plus";

export default function myconfirm(text: string): Promise<boolean> {
  return new Promise((resolve) => {
    ElMessageBox.confirm(text, "系统提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    })
      .then(() => {
        // 点击“确定”按钮
        resolve(true);
      })
      .catch(() => {
        // 点击“取消”按钮
        resolve(false); // 直接解析为 false，而不是拒绝
      });
  });
}
